﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ESupervision.Models;

namespace ESupervision.Services
{
    /// <summary>
    /// Message Service interface defines methods that support Message feature.
    /// </summary>
    public interface IMessageService
    {
        /// <summary>
        /// Send Message to a list of ApplicationUser
        /// </summary>
        /// <param name="message">Message to send</param>
        /// <param name="receivers">List of Receivers</param>
        /// <returns>Number of message sent</returns>
        Task<int> SendMessage( ApplicationDbContext db, Message message, List<ApplicationUser> receivers);
        /// <summary>
        /// Delete Received Message
        /// </summary>
        /// <param name="id">Receive Message ID</param>
        /// <returns></returns>
        Task DeleteReceivedMessage(ApplicationDbContext db, int id);
        /// <summary>
        /// Delete Sent Message
        /// </summary>
        /// <param name="id">Sent Message ID</param>
        /// <returns></returns>
        Task DeleteSentMessage(ApplicationDbContext db, int id);
        /// <summary>
        /// Get message in user inbox
        /// </summary>
        /// <param name="userId">User ID</param>
        /// <returns>List of MessageRecipient</returns>
        Task<List<MessageRecipient>> GetInboxMessages(ApplicationDbContext db, string userId);
        /// <summary>
        /// Get message in user Sent
        /// </summary>
        /// <param name="userId">User ID</param>
        /// <returns>List of MessageSent</returns>
        Task<List<MessageSent>> GetSentMessages(ApplicationDbContext db, string userId);
    }
}
